package top.vanchor.myblog2back;

import com.alibaba.fastjson.JSONObject;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.jar.JarEntry;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Ding
 * @create 2022/2/3 20:27
 */
public class text2 {
//    {"lastNum":17,"sendPoker":[{"c":"♣","s":1,"n":"A"}],"msgType":2,"lastPoker":[]}
    public static void main(String[] args) {
        JSONObject j = new JSONObject();
        j.put("lastNum",17);
        ArrayList<Map<String,Object>> arrayList = new ArrayList<>();
        ArrayList<Map<String,Object>> arrayList2 = new ArrayList<>();
        Map<String,Object> map = new HashMap<>();
        map.put("c","♣");
        map.put("s","1");
        map.put("n","A");
        arrayList.add(map);
        j.put("sendPoker",arrayList);
        j.put("lastPoker",arrayList2);

        Object obj = j;

        JSONObject jsonObject = (JSONObject) obj;
        System.err.println(jsonObject);

        ArrayList<Map<String,Object>> demo = ( ArrayList<Map<String,Object>>) jsonObject.get("sendPoker");
        System.err.println(demo);
    }
}
